using System;
using System.Collections.Generic;
using System.Text;

namespace Tortuga.Core.TortoiseCommands {
	/// <summary>
	/// "Marks a conflicted file specified in /path as resolved. If /noquestion is given, then resolving is done without asking the user first if it really should be done."
	/// http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/apc.html
	/// </summary>
	public class ResolveCommand : TortoiseCommand {
		private bool _noQuestion = false;

		public ResolveCommand()
			: base("resolve") {
			this.OptionsToBuild = new List<BuildOptionDelegate>(new BuildOptionDelegate[] {
				this.BuildPathOption,
				this.BuildNoQuestionOption,
				this.BuildNoTempFile,
				this.BuildCloseOnEnd
			});
		}
		public ResolveCommand(params string[] path)
			: this() {
			this.Path = new List<string>(path);
		}

		public ResolveCommand(bool noQuestion, params string[] path) : this(path) {
			this.NoQuestion = noQuestion;
		}

		/// <summary>
		/// Gets or sets whether a confirmation dialog should be shown.
		/// </summary>
		public bool NoQuestion {
			get { return _noQuestion; }
			set { _noQuestion = value; }
		}

		public string BuildNoQuestionOption() {
			return BuildNoQuestionOption(this.NoQuestion);
		}

		public static string BuildNoQuestionOption(bool noQuestion) {
			return BuildOption("noquestion", noQuestion);
		}
	}
}
